#ifndef LONGPOLL_API_H
#define LONGPOLL_API_H
struct LongPoll;
typedef int (*ConstructLongPollDUPReqFn)(void* p_env, char **p_req_msg);
typedef int (*OnNotifyFn)(void* p_env, char *rsp_msg);
typedef int (*AfterNotifyCB)( void *arg );

int LongPollWriteAlertLog( char *c_filename , long c_fileline , int log_level, char *format , ... );
void SetLongPollLoglevel( char* p_loglevel );
int InitLongPollLogEnv();
void CleanLongPollLogEnv();

LongPoll* CreateLongPollEnv(int longpoll_timeout, char* p_servers, ConstructLongPollDUPReqFn ConstructLongPollReq, OnNotifyFn OnNotify, AfterNotifyCB pCallback, void* arg, void* reserve);
int StartLongPoll( LongPoll* p_longpoll_env );
void DestroyLongPollEnv(LongPoll* p_longpoll_env );
void* GetLongPollReserve(LongPoll* p_longpoll_env );
const char* GetLongPollClientId(LongPoll* p_longpoll_env );
const char* GetLongPollClientIp(LongPoll* p_longpoll_env );
int GetLongPollClientPort(LongPoll* p_longpoll_env );
const char* GetLongPollServerIp(LongPoll* p_longpoll_env );
int GetLongPollServerPort(LongPoll* p_longpoll_env );
void SetLongPollRebalanceFlag(LongPoll* p_longpoll_env, bool flag);
#endif // LONGPOLL_API_H
